3.9.16 \(\int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx\) [816]

Optimal. Leaf size=149 \[ \frac {a d \cos (e+f x) (d \csc (e+f x))^{-1+n} \, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3-n}{2};\sin ^2(e+f x)\right )}{f (1-n) \sqrt {\cos ^2(e+f x)}}+\frac {a d^2 \cos (e+f x) (d \csc (e+f x))^{-2+n} \, _2F_1\left (\frac {1}{2},\frac {2-n}{2};\frac {4-n}{2};\sin ^2(e+f x)\right )}{f (2-n) \sqrt {\cos ^2(e+f x)}} \]

[Out]

a*d*cos(f*x+e)*(d*csc(f*x+e))^(-1+n)*hypergeom([1/2, 1/2-1/2*n],[3/2-1/2*n],sin(f*x+e)^2)/f/(1-n)/(cos(f*x+e)^
2)^(1/2)+a*d^2*cos(f*x+e)*(d*csc(f*x+e))^(-2+n)*hypergeom([1/2, 1-1/2*n],[2-1/2*n],sin(f*x+e)^2)/f/(2-n)/(cos(
f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 149, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3317, 3872, 3857, 2722} \begin {gather*} \frac {a d^2 \cos (e+f x) (d \csc (e+f x))^{n-2} \, _2F_1\left (\frac {1}{2},\frac {2-n}{2};\frac {4-n}{2};\sin ^2(e+f x)\right )}{f (2-n) \sqrt {\cos ^2(e+f x)}}+\frac {a d \cos (e+f x) (d \csc (e+f x))^{n-1} \, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3-n}{2};\sin ^2(e+f x)\right )}{f (1-n) \sqrt {\cos ^2(e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Csc[e + f*x])^n*(a + a*Sin[e + f*x]),x]

[Out]

(a*d*Cos[e + f*x]*(d*Csc[e + f*x])^(-1 + n)*Hypergeometric2F1[1/2, (1 - n)/2, (3 - n)/2, Sin[e + f*x]^2])/(f*(
1 - n)*Sqrt[Cos[e + f*x]^2]) + (a*d^2*Cos[e + f*x]*(d*Csc[e + f*x])^(-2 + n)*Hypergeometric2F1[1/2, (2 - n)/2,
 (4 - n)/2, Sin[e + f*x]^2])/(f*(2 - n)*Sqrt[Cos[e + f*x]^2])

Rule 2722

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1
)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 3317

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Csc[e + f*x])^(m - n*p)*(b + a*Csc[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rule 3857

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rubi steps

\begin {align*} \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx &=d \int (d \csc (e+f x))^{-1+n} (a+a \csc (e+f x)) \, dx\\ &=a \int (d \csc (e+f x))^n \, dx+(a d) \int (d \csc (e+f x))^{-1+n} \, dx\\ &=\left (a (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{-n} \, dx+\left (a d (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{1-n} \, dx\\ &=\frac {a \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3-n}{2};\sin ^2(e+f x)\right ) \sin (e+f x)}{f (1-n) \sqrt {\cos ^2(e+f x)}}+\frac {a \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {2-n}{2};\frac {4-n}{2};\sin ^2(e+f x)\right ) \sin ^2(e+f x)}{f (2-n) \sqrt {\cos ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 1.20, size = 278, normalized size = 1.87 \begin {gather*} \frac {2^{-1+n} a e^{-i (e+f n x)} \left (1-e^{2 i (e+f x)}\right )^n \left (\frac {i e^{i (e+f x)}}{-1+e^{2 i (e+f x)}}\right )^n \csc ^{-1-n}(e+f x) (d \csc (e+f x))^n (1+\csc (e+f x)) \left (e^{i f (-1+n) x} n (1+n) \, _2F_1\left (\frac {1}{2} (-1+n),n;\frac {1+n}{2};e^{2 i (e+f x)}\right )-e^{i e} (-1+n) \left (2 i e^{i f n x} (1+n) \, _2F_1\left (\frac {n}{2},n;\frac {2+n}{2};e^{2 i (e+f x)}\right )+e^{i (e+f (1+n) x)} n \, _2F_1\left (n,\frac {1+n}{2};\frac {3+n}{2};e^{2 i (e+f x)}\right )\right )\right )}{f (-1+n) n (1+n) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*Csc[e + f*x])^n*(a + a*Sin[e + f*x]),x]

[Out]

(2^(-1 + n)*a*(1 - E^((2*I)*(e + f*x)))^n*((I*E^(I*(e + f*x)))/(-1 + E^((2*I)*(e + f*x))))^n*Csc[e + f*x]^(-1
- n)*(d*Csc[e + f*x])^n*(1 + Csc[e + f*x])*(E^(I*f*(-1 + n)*x)*n*(1 + n)*Hypergeometric2F1[(-1 + n)/2, n, (1 +
 n)/2, E^((2*I)*(e + f*x))] - E^(I*e)*(-1 + n)*((2*I)*E^(I*f*n*x)*(1 + n)*Hypergeometric2F1[n/2, n, (2 + n)/2,
 E^((2*I)*(e + f*x))] + E^(I*(e + f*(1 + n)*x))*n*Hypergeometric2F1[n, (1 + n)/2, (3 + n)/2, E^((2*I)*(e + f*x
))])))/(E^(I*(e + f*n*x))*f*(-1 + n)*n*(1 + n)*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2)

________________________________________________________________________________________

Maple [F]
time = 0.18, size = 0, normalized size = 0.00 \[\int \left (d \csc \left (f x +e \right )\right )^{n} \left (a +a \sin \left (f x +e \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x)

[Out]

int((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

integrate((a*sin(f*x + e) + a)*(d*csc(f*x + e))^n, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

integral((a*sin(f*x + e) + a)*(d*csc(f*x + e))^n, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \left (d \csc {\left (e + f x \right )}\right )^{n}\, dx + \int \left (d \csc {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))**n*(a+a*sin(f*x+e)),x)

[Out]

a*(Integral((d*csc(e + f*x))**n, x) + Integral((d*csc(e + f*x))**n*sin(e + f*x), x))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

integrate((a*sin(f*x + e) + a)*(d*csc(f*x + e))^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (\frac {d}{\sin \left (e+f\,x\right )}\right )}^n\,\left (a+a\,\sin \left (e+f\,x\right )\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d/sin(e + f*x))^n*(a + a*sin(e + f*x)),x)

[Out]

int((d/sin(e + f*x))^n*(a + a*sin(e + f*x)), x)

________________________________________________________________________________________